home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Examples / DriverKit / QVision / QVision_reloc.tproj / QVisionModes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-26  |  3.3 KB  |  127 lines

  1. /* CONFIDENTIAL
  2.  * Copyright (c) 1993 by NeXT Computer, Inc as an unpublished work.
  3.  * All rights reserved.
  4.  *
  5.  * QVisionModes.h -- internal definitions for QVision driver.
  6.  *
  7.  * Author:  Derek B Clegg    21 May 1993
  8.  *
  9.  * Based on work by Joe Pasqua, 30 September 1992.
  10.  */
  11.  
  12. #ifndef QVISIONMODES_H__
  13. #define QVISIONMODES_H__
  14.  
  15. #import <objc/objc.h>
  16. #import <mach/mach.h>
  17. #import <driverkit/displayDefs.h>
  18. #import "vgaModes.h"
  19.  
  20. #define QVISION_ISA_ID   0x0E113021
  21. #define    QVISION_EISA_ID  0x0E113011
  22. #define    ORION_ISA_ID     0x0E113121
  23. #define    ORION_EISA_ID    0x0E113111
  24. #define    ORION12_ISA_ID   0x0E113122
  25. #define    ORION12_EISA_ID  0x0E113112
  26.  
  27. enum QVAdapterType {
  28.     UnknownAdapter = -1,
  29.     QVisionAdapter = 0,
  30.     OrionAdapter = 1,
  31.     Orion12Adapter = 2,
  32.     QVision1280P = 3        /* PCI card */
  33. };
  34. typedef enum QVAdapterType QVAdapterType;
  35.  
  36. enum DACtype {
  37.     UnknownDAC,
  38.     Bt484,        /* BrookTree 484. */
  39.     Bt485,        /* BrookTree 485. */
  40.     Bt485A,        /* BrookTree 485A. */
  41.     ATT20C505    /* AT&T 20C505 */
  42. };
  43. typedef enum DACtype DACtype;
  44.  
  45. /* Sizes of the various data sets. */
  46.  
  47. struct QVisionMode {
  48.     const char *name;        /* The name of this mode. */
  49.     QVAdapterType adapter;    /* The adapter required for this mode. */
  50.     BOOL needsPixelDoubling;    /* YES if this mode requires pixel doubling. */
  51.  
  52.     /* Control register 1 value (63CA).  */
  53.     unsigned char ctrlReg1;
  54.  
  55.     /* DAC command register 1 value (13C8). */
  56.     unsigned char dacCmd1;
  57.  
  58.     /* Overflow register 1 value (3CF.42). */
  59.     unsigned char overflow1;
  60.  
  61.     /* Overflow register 2 values (3CF.51). */
  62.     unsigned char overflow2;
  63.  
  64.     /* Standard VGA data. */
  65.     VGAMode vgaData;
  66. };
  67. typedef struct QVisionMode QVisionMode;
  68.  
  69. extern const IODisplayInfo QVisionModeTable[];
  70. extern const int QVisionModeTableCount;
  71.  
  72. #define DEFAULT_QVISION_MODE    13    /* 1024 x 768 x 8 @ 66Hz. */
  73. #define DEFAULT_ORION_MODE    9    /* 1024 x 768 x 15 @ 60Hz. */
  74. #define DEFAULT_ORION12_MODE    9    /* 1024 x 768 x 15 @ 60Hz. */
  75. #define DEFAULT_1280P_MODE    9    /* 1024 x 768 x 15 @ 60Hz. */
  76.  
  77. /* Port Addresses for Various Registers */
  78.  
  79. #define SEQ_PIXEL_WR_MSK    0x02
  80. #define GC_PLANE_WR_MSK        0x08
  81.  
  82. /* Control Registers */
  83. #define PAGE_REG_0        0x45    /* This is a GFXC index. */
  84. #define PAGE_REG_1        0x46    /* This is a GFXC index. */
  85. #define HI_ADDR_MAP        0x48    /* This is a GFXC index. */
  86. #define ENV_REG_1        0x50    /* This is a GFXC index. */
  87. #define VIRT_CTRLR_SEL        0x83C4
  88. #define CTRL_REG_1        0x63CA
  89. #define    QVGA_CTL_2        0x23C7
  90. #define    QVGA_CTL_3        0x63CB
  91.  
  92. /* CTRL_REG_1 values */
  93. #define PACKED_PIXEL_VIEW    0x00
  94. #define PLANAR_VIEW          0x08
  95. #define EXPAND_TO_FG         0x10
  96. #define EXPAND_TO_BG         0x18
  97. #define BITS_PER_PIX_4       0x00
  98. #define BITS_PER_PIX_8       0x02
  99. #define BITS_PER_PIX_16      0x04
  100. #define BITS_PER_PIX_32      0x06
  101.  
  102. /* DAC Registers */
  103.  
  104. #define PALETTE_WRITE        0x3C8
  105. #define PALETTE_READ        0x3C7
  106. #define PALETTE_DATA        0x3C9
  107. #define CO_COLOR_WRITE        0x83C8
  108. #define CO_COLOR_DATA        0x83C9
  109. #define DAC_CMD_0        0x83C6
  110. #define DAC_CMD_1        0x13C8
  111. #define DAC_CMD_2        0x13C9
  112. #define    DAC_EXT_REG        0x13C6
  113.  
  114.  
  115. /*  Use IOLog_dbg(("format", arg, ...)) to get debugging ingo when building
  116.     the `debug' target.  Actually though, it is a whole lot easier to define
  117.     DEBUG here so `make install' works normally.  */
  118. #ifdef QVISION_DEBUG
  119. #define IOLog_dbg(x) IOLog x
  120. #else
  121. #define IOLog_dbg(x)
  122. #endif
  123.  
  124.  
  125.  
  126. #endif    /* QVISIONMODES_H__ */
  127.